﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<div id="mainLogin">
    <div class="content Clearfix">
       
        <form id="frmLogin" action="/Admin/Login">
        <div class="FromLogin">
             <div class="LogoLogin Clearfix">
                    <img src="../../Content/image/Logo_Admin.png" />
                </div>
            <div class="Clearfix lgInput">
                <input type="text" name="UserName" class="inputUsName"  onkeypress=" if (event.keyCode == 13) {submitLogin();}"  />
                <br />
                <input type="password" name="Password" class="inputPass" onkeypress=" if (event.keyCode == 13) {submitLogin();}"  />
            </div>
            <div>
                <button type="button" class="bntLogin" onclick="submitLogin();">
                    Login</button>
            </div>
        </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    function submitLogin() {
        //Account_Script.submitLogin(this.document.forms[0]);

        $.ajax({ type: 'POST', url: '/Admin/Login', data: $('#frmLogin').serialize(), success: function (response) {            
            if (response == "False") {
                alert("User Name or Password Invalid!!");
            }
            else {
                Utils.navigate(response);
            }
        }
        });

    }
</script>
